// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#pragma once
#ifdef OPENGPU
#include "bfcallocator/fence.h"
#include "bfcallocator/cuda_call.h"

namespace bfcallocator {
class GPUDataTransfer;

class CUDAFence : public IFence {
 public:
  CUDAFence(const GPUDataTransfer* data_transfer);
  virtual ~CUDAFence();
  // virtual void BeforeUsingAsInput(bfcallocator::ProviderType provider_type, int queue_id) override;
  // virtual void BeforeUsingAsOutput(bfcallocator::ProviderType provider_type, int queue_id) override;
  // virtual void AfterUsedAsInput(int queue_id) override;
  // virtual void AfterUsedAsOutput(int queue_id) override;
  // virtual bool CanRelease() override;

 private:
  cudaEvent_t read_event_;
  cudaEvent_t write_event_;
  const GPUDataTransfer* data_transfer_;
};

}  // namespace bfcallocator
#endif